//询问框
yii.confirm = function(message,ok) { 
	layer.confirm(message, {
		title: '操作',
	}, function() { 
		ok();
	});
	return false;
}
//layer iframe弹出框
$(document).on('click','.lay-iframe-edit',function() { 
	var url = $(this).attr('data-url');
	var size = $(this).attr('data-area');
	var size = size?size.split(','):['90%','90%'];
	layer.open({
		type: 2,
	  	title: '编辑',
	  	shadeClose: true,
	  	area: size,
	  	content: [url,'no'], //iframe的url
	  	btn: ['编辑','取消'],
        yes: function(index, layero){
            var form = layer.getChildFrame('#form', index);
            var url = form.attr('action');
            $.post(url,form.serialize(),function(res) {
                if(res.status == 1) { 
                	layer.msg(res.message);
                	window.location.reload();
                }else { 
                	layer.msg(res.message);
                }
            })
            //layer.close(index); //如果设定了yes回调，需进行手工关闭
        }
	}); 
})
